1. Field of the Invention
The invention relates to a noise reduction method and, more particularly, relates to a method for effectively reducing noises of an image frame by using a one-dimensional median algorithm and a slope algorithm.
2. Description of the Prior Art
In order to reduce noises of an image frame, various methods have been disclosed to date. In these methods, the conventional median algorithm is usually put to use. Referring to FIG. 1A and FIG. 1B, FIG. 1A is a schematic diagram illustrating a sub-matrix 10 of an image frame 1 before processed by a median algorithm, and FIG. 1B is a schematic diagram illustrating the sub-matrix 10 of the image frame 1 after processed by a median algorithm. The median algorithm comprises the following steps of: (a) in pixel matrix of the image frame 1, selecting the sub-matrix 10 with a target pixel in the center; (b) sorting gray levels of all pixels within the sub-matrix 10; and (c) selecting a median value of the gray levels to be a new gray level of the target pixel. It should be noted that the sub-matrix can be a 3*3 matrix, a 5*5 matrix, or the like.
As shown in FIG. 1, the sub-matrix 10 is a 3*3 matrix comprising nine pixels, and gray levels of the pixels are sorted in magnitude as 11, 23, 23, 49, 51, 51, 54, 98, and 99. In other words, a median value of the gray levels of the pixels in the sub-matrix 10 is 51. Therefore, according to the median algorithm, the gray level (23) of the target pixel will be replaced with the median value (51) as shown in FIG. 1B.
However, when the median algorithm is used for reducing noises of an image frame, a memory is needed for storing two-dimensional image data, and then a follow-up calculation can be performed. By this manner, a large amount of data has to be stored, and the processing efficiency is lower. If the median algorithm can be performed on one-dimensional image data, the processing efficiency will get higher, and the memory for storing the image data can be removed. However, if the median algorithm is performed on one-dimensional image data, that will cause large error.
Accordingly, the scope of the invention is to provide a noise reduction method for solving the aforesaid problems.